Comment: Default Setup Project
 
Set Variable PACKAGE_PRODUCTCODE to {4BEED2C8-3737-45A6-892C-C284F42889D1}
Set Variable ERROR_ONE to 
Set Variable ERROR_TWO to 
Set Variable PACKAGE_INSTALLED to FALSE
Get Installed State for Windows Installer Setup $PACKAGE_PRODUCTCODE$ into Variable PACKAGE_INSTALLED
 
if Variable PACKAGE_INSTALLED Equals FALSE
  MessageBox: $TITLE$, Press OK to install the package.
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  Install/Remove MSI Package $SUPPORTDIR$\SysTest.msi[ADDLOCAL=ALL] (get result into variable ERROR_ONE)
else
  MessageBox: $TITLE$, Press OK to Un-Install the package.
  Display Dialog: progressprereq, use as progress dialog (non-modal)
  Install/Remove MSI Package $PACKAGE_PRODUCTCODE$[REMOVE=ALL] (get result into variable ERROR_ONE)
end
Hide Dialog
 
if Variable ERROR_ONE Equals ERROR
  MessageBox: $TITLE$ Setup, Error while uninstalling/installing.$NEWLINE$$NEWLINE$$ERROR_TWO$
  Terminate Installation
end
if Variable ERROR_ONE Equals REBOOT
  MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
  if Variable REBOOTNOW Equals OK
    Reboot Computer and Resume Setup
  else
    Terminate Installation
  end
end
 
MessageBox: $TITLE$, Completed!
 
